#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@create Time:2019-01-11

@author:Brook
"""
import time


def timing(func):
    def wrapper(*args, **kwargs):
        start = time.time()
        result = func(*args, **kwargs)
        runtime = time.time() - start
        print("<%s> spend %2.5fs" % (func.__name__, runtime))
        return result
    return wrapper


@timing
def test(t):
    time.sleep(t)
    return t*3


if __name__ == "__main__":
    a = test(3)
    print(a)
